//
//  GoodsStandardsCell.m
//  WeiYiMei
//
//  Created by 李叶夫 on 2019/4/18.
//  Copyright © 2019年 liyefu. All rights reserved.
//

#import "GoodsStandardsCell.h"

@implementation GoodsStandardsCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setupSubViews];
    }
    return self;
}

- (void)setupSubViews
{
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.font = [UIFont systemFontOfSize:13];
    self.titleLab.textColor = kColor333333;
    self.titleLab.layer.cornerRadius = 3;
    self.titleLab.layer.masksToBounds = YES;
    self.titleLab.backgroundColor = kColorF2F2F2;
    self.titleLab.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.titleLab];
    
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self).offset(1);
        make.bottom.right.equalTo(self).offset(-1);
    }];
}

- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    
    if (selected) {
        self.titleLab.layer.borderWidth = 1;
        self.titleLab.layer.borderColor = UIColorFromRGB(0x2782FF).CGColor;
        self.titleLab.backgroundColor = [UIColor whiteColor];
        self.titleLab.textColor = UIColorFromRGB(0x2782FF);
    }
    else {
        self.titleLab.layer.borderWidth = 0;
        self.titleLab.backgroundColor = kColorF2F2F2;
        self.titleLab.textColor = kColor333333;
    }
    
}

@end
